import React, { Component } from 'react';
import Header from './common/header'
import store from './store/index';
import { Provider } from 'react-redux';
// import { BrowserRouter, Route } from 'react-router-dom';
import { HashRouter, Route } from 'react-router-dom';
import Home from './pages/Home/loadable';
import Detail from './pages/Detail/loadable';
import Login from './pages/Login/loadable';
import Write from './pages/Write/loadable'

class App extends Component {
    render() {
        return (
            <Provider store={store}>
                <HashRouter>
                    <div>
                        <Header />
                        <Route path='/'
                            exact
                            component={Home}>
                        </Route>
                        <Route path='/login'
                            exact
                            component={Login}>
                        </Route>
                        <Route path='/detail/:id'
                            exact
                            component={Detail}>
                        </Route>
                        <Route path='/write'
                            exact
                            component={Write}>
                        </Route>
                    </div>
                </HashRouter>
            </Provider>
        )
    }
}

export default App